#include <kfbxwriter.h>
This class provides the interfaces for writing files.
The role of the writer is to effectively "write" specific file data vs the role of the exporter is to select a specific writer and launch the writing of a file through that writer.
A SDK user should - normally - not use this class, except if a custom writer must be created for plug-in extension, then KFbxWriter must be the base class for the new custom writer in that particular situation.
Definition at line 85 of file kfbxwriter.h.
Public Types |
|
enum | EError { eFILE_CORRUPTED, eFILE_NOT_OPENED, eFILE_NOT_CREATED, eOUT_OF_DISK_SPACE, eINVALID_DOCUMENT_HANDLE, eDOCUMENT_NOT_SUPPORTED, eUNIDENTIFIED_ERROR, eEMBEDDED_OUT_OF_SPACE, eERROR_COUNT } |
Error identifiers. More... |
|
enum | KInfoRequest
{ eInfoExtension, eInfoDescriptions, eInfoVersions, eInfoCompatibleDesc, eInfoUILabel, eReserved1 = 0xFBFB } |
|
|
typedef KFbxWriter *(* | CreateFuncType )(KFbxSdkManager &pManager, KFbxExporter &pExporter, int pSubID, int pPluginID) |
Helper typedef for passing KFbxWriter
creator function as argument (used internally). |
|
typedef void(* | IOSettingsFillerFuncType )(KFbxIOSettings &pIOS) |
Helper typedef for passing KFbxIOSettings
creator function as argument (used internally). |
|
typedef void *(* | GetInfoFuncType )(KInfoRequest pRequest, int pWriterTypeId) |
Helper typedef for passing KInfoRequest
function as argument (used internally). |
|
Public Member Functions |
|
KFbxWriter (KFbxSdkManager &pManager, int pID) | |
Constructor. |
|
virtual | ~KFbxWriter () |
Destructor. |
|
virtual bool | FileCreate (char *pFileName)=0 |
Creates a new file. |
|
virtual bool | FileClose ()=0 |
Closes the file. |
|
virtual bool | IsFileOpen ()=0 |
Test if the file is open. |
|
virtual void | GetWriteOptions ()=0 |
Setup write options. |
|
virtual bool | Write (KFbxDocument *pDocument)=0 |
Writes content to the specified file with
given stream options. |
|
virtual bool | PreprocessScene (KFbxScene &pScene)=0 |
Pre-processes the scene. |
|
virtual bool | PostprocessScene (KFbxScene &pScene)=0 |
Post-processes the scene. |
|
virtual void | PluginWriteParameters (KFbxObject &pParams) |
Writes extension plug-ins name, version and
parameters, so that we can remember if a plug-in was used during
export. |
|
virtual KFbxNode * | FindRootNode (KFbxScene &pScene) |
Finds the selected root node in the
specified scene. |
|
virtual bool | CheckSpaceInNodeNameRecursive (KFbxNode *pNode, KString &pNodeNameList) |
Checks if there are spaces in the names of
specified node (and its children nodes), and writes the returned
node's name in the specified string list. |
|
bool | SetFileExportVersion (KString pVersion) |
Sets the file export version as specified.
|
|
void | SetRenamingMode (KFbxSceneRenamer::ERenamingMode pRenamingMode) |
Sets the renaming mode as specified.
|
|
void | SetResamplingRate (double pResamplingRate) |
Sets the resampling rate as specified.
|
|
bool | IsGenuine () |
Test if file format is an internal plug-in .
|
|
KError & | GetError () |
Returns error object(s). |
|
EError | GetLastErrorID () const |
Returns the ID of the last error that
occurred when the file was written. |
|
const char * | GetLastErrorString () const |
Returns the error string that describes the
last error that occurred when the file was written. |
|
void | GetMessage (KString &pMessage) const |
Returns a warning message that describes
what occurred when the file was written. |
|
KString & | GetMessage () |
Returns a warning message that describes
what occurred when the file was written. |
|
void | ClearMessage () |
Empties the message string. |
|
virtual KFbxIOSettings * | GetIOSettings () |
Access to a IOSettings object. |
|
virtual void | SetIOSettings (KFbxIOSettings *pIOSettings) |
Set the IOSettings pointer to be used for
this writer instance. |
|
virtual void | SetProgressHandler (KFbxProgress *pProgress) |
Pass a progress handler to the writer.
|
|
Protected Member Functions |
|
void | PluginsWriteBegin (KFbxScene &pScene) |
void | PluginsWrite (KFbx &pFbx, bool pWriteObjectId) |
void | PluginsWriteEnd (KFbxScene &pScene) |
KFbxWriter & | operator= (KFbxWriter const &) |
Protected Attributes |
|
KFbxSdkManager & | mManager |
KString | mFileVersion |
double | mResamplingRate |
KFbxSceneRenamer::ERenamingMode | mRenamingMode |
Friends |
|
struct | KFbxWriterFbx7Impl |
typedef KFbxWriter*(* CreateFuncType)(KFbxSdkManager &pManager, KFbxExporter &pExporter, int pSubID, int pPluginID) |
Helper typedef for passing KFbxWriter creator function as argument (used internally).
typedef void(* IOSettingsFillerFuncType)(KFbxIOSettings &pIOS) |
Helper typedef for passing KFbxIOSettings creator function as argument (used internally).
typedef void*(* GetInfoFuncType)(KInfoRequest pRequest, int pWriterTypeId) |
Helper typedef for passing KInfoRequest function as argument (used internally).
enum EError |
Error identifiers.
eFILE_CORRUPTED | |
eFILE_NOT_OPENED | |
eFILE_NOT_CREATED | |
eOUT_OF_DISK_SPACE | |
eINVALID_DOCUMENT_HANDLE | |
eDOCUMENT_NOT_SUPPORTED | |
eUNIDENTIFIED_ERROR | |
eEMBEDDED_OUT_OF_SPACE | |
eERROR_COUNT |
Definition at line 108 of file kfbxwriter.h.
enum KInfoRequest |
eInfoExtension | |
eInfoDescriptions | |
eInfoVersions | |
eInfoCompatibleDesc | |
eInfoUILabel | |
eReserved1 |
Definition at line 130 of file kfbxwriter.h.
KFbxWriter | ( | KFbxSdkManager & | pManager, | |
int | pID | |||
) |
Constructor.
pManager | The KFbxSdkManager Object | |
pID | Id for current writer |
virtual ~KFbxWriter | ( | ) | [virtual] |
Destructor.
virtual bool FileCreate | ( | char * | pFileName | ) | [pure virtual] |
Creates a new file.
pFileName | The name of the newly created file. |
virtual bool FileClose | ( | ) | [pure virtual] |
Closes the file.
virtual bool IsFileOpen | ( | ) | [pure virtual] |
Test if the file is open.
virtual void GetWriteOptions | ( | ) | [pure virtual] |
Setup write options.
virtual bool Write | ( | KFbxDocument * | pDocument | ) | [pure virtual] |
Writes content to the specified file with given stream options.
pDocument | KFbxDocument to write file data to. |
virtual bool PreprocessScene | ( | KFbxScene & | pScene | ) | [pure virtual] |
Pre-processes the scene.
pScene | The scene needs to be pre-processed. |
virtual bool PostprocessScene | ( | KFbxScene & | pScene | ) | [pure virtual] |
Post-processes the scene.
pScene | The scene needs to be post-processed. |
virtual void PluginWriteParameters | ( | KFbxObject & | pParams | ) | [virtual] |
Writes extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.
This is especially useful for extension plug-ins that modify the scene and also to warn users during import if an extension plug-in was used that could be missing.
pParams | The parameters of the extension plug-in. The properties of the objects are used as the parameters of the extension plug-in. |
Finds the selected root node in the specified scene.
pScene | The scene in which the selected root node is found. |
NULL
if the selected root
node cannot be found.Checks if there are spaces in the names of specified node (and its children nodes), and writes the returned node's name in the specified string list.
pNode | Specifies the node to check. | |
pNodeNameList | Specifies the string list where the node name that has spaces in it is recorded. |
true
If there are no spaces in the name of
specified node (and its children nodes), false
If
spaces are found.bool SetFileExportVersion | ( | KString | pVersion | ) |
Sets the file export version as specified.
pVersion | The specified file export version. |
void SetRenamingMode | ( | KFbxSceneRenamer::ERenamingMode | pRenamingMode | ) | [inline] |
Sets the renaming mode as specified.
pRenamingMode | The specified renaming mode. |
Definition at line 213 of file kfbxwriter.h.
void SetResamplingRate | ( | double | pResamplingRate | ) | [inline] |
Sets the resampling rate as specified.
pResamplingRate | The specified resampling rate. |
Definition at line 218 of file kfbxwriter.h.
bool IsGenuine | ( | ) |
Test if file format is an internal plug-in .
A non genuine plug-in is a plug-in made by someone external to Autodesk FBX SDK group.
true
If the file format is an internal plug-in
,false
Otherwise .KError& GetError | ( | ) |
Returns error object(s).
EError GetLastErrorID | ( | ) | const |
Returns the ID of the last error that occurred when the file was written.
const char* GetLastErrorString | ( | ) | const |
Returns the error string that describes the last error that occurred when the file was written.
void GetMessage | ( | KString & | pMessage | ) | const |
Returns a warning message that describes what occurred when the file was written.
pMessage | The returned warning message. |
KString& GetMessage | ( | ) |
Returns a warning message that describes what occurred when the file was written.
void ClearMessage | ( | ) |
Empties the message string.
virtual KFbxIOSettings* GetIOSettings | ( | ) | [virtual] |
Access to a IOSettings object.
NULL
if
the object has not been allocated.virtual void SetIOSettings | ( | KFbxIOSettings * | pIOSettings | ) | [virtual] |
Set the IOSettings pointer to be used for this writer instance.
pIOSettings |
virtual void SetProgressHandler | ( | KFbxProgress * | pProgress | ) | [inline, virtual] |
Pass a progress handler to the writer.
pProgress | KFbxProgress to store the progress information. |
Definition at line 269 of file kfbxwriter.h.
void PluginsWriteBegin | ( | KFbxScene & | pScene | ) | [protected] |
void PluginsWrite | ( | KFbx & | pFbx, | |
bool | pWriteObjectId | |||
) | [protected] |
void PluginsWriteEnd | ( | KFbxScene & | pScene | ) | [protected] |
KFbxWriter& operator= | ( | KFbxWriter const & | ) | [inline, protected] |
Definition at line 276 of file kfbxwriter.h.
friend struct KFbxWriterFbx7Impl
[friend] |
Definition at line 289 of file kfbxwriter.h.
KFbxSdkManager& mManager
[protected] |
Definition at line 278 of file kfbxwriter.h.
KString
mFileVersion
[protected] |
Definition at line 279 of file kfbxwriter.h.
double
mResamplingRate
[protected] |
Definition at line 280 of file kfbxwriter.h.
KFbxSceneRenamer::ERenamingMode
mRenamingMode
[protected] |
Definition at line 281 of file kfbxwriter.h.